<template>
  <a-modal
    :title="title"
    :width="width"
    :visible="visible"
    :confirmLoading="confirmLoading"
    :maskClosable="true"
    @cancel="handleCancel"
    :footer="null">
    <a-spin :spinning="confirmLoading">
    <div>
      <div style="text-align: center">
        <img style="width: 350px;height: 600px" :src="imgBase64"/>
      </div>
    </div>
    </a-spin>
  </a-modal>
</template>

<script>
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import { validateDuplicateValue,filterObj } from '@/utils/util'
  import { httpAction } from '@/api/manage'
  export default {
    name: "GlrLedImgShow",
    mixins:[JeecgListMixin],
    components: {
    },
    data () {
      return {
        description: '当前LED屏图片',
        disableMixinCreated:true,
        title:"操作",
        width:500,
        visible: false,
        confirmLoading: false,
        imgBase64:'',
        url: {
          getLedImgByCode: "/glr/glrLed/getLedImgByCode",
        },
      }
    },
    computed: {
      importExcelUrl: function(){
        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
      }
    },

    methods: {
      initDictConfig(){
      },
      handleCancel () {
        this.close()
      },
      close () {
        this.$emit('close');
        this.visible = false;
      },
      add(record){
        var _this=this;
        _this.visible = true;
        httpAction(_this.url.getLedImgByCode,{code:record.code},"POST").then((res)=>{
          if(res.success){
            _this.imgBase64="data:image/png;base64,"+res.message;
          }else{
            _this.$message.warning(res.message);
          }
        }).finally(() => {
          _this.confirmLoading = false;
        })
      }
    }
  }
</script>

<style scoped>

</style>